#include "include.h"

/*  定义一个定时回调函数*/
Ticker tciker_Led;  //实例化定时器对象


void Led_blink_init() {
    pinMode(LED_BUILTIN, OUTPUT);
    /*  绑定回调函数，默认定时1000ms*/
    // switch_Led_Fre_Blink(1000);
}

void switch_Led_Fre_Blink(int speed){
    if(speed != system_status.Led_blink_interval){
        tciker_Led.attach_ms(speed, Led_blink_callback);
    }
}

/*
 *  LED闪烁 - tciker回调函数
 */
void Led_blink_callback() {
    static boolean output = HIGH; 
    digitalWrite(LED_BUILTIN, !output);  
    output=!output;
}
